#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<string>
#include<vector>
#include<queue>
using namespace std;

class Node {
public:
    int val;
    vector<Node*> children;

    Node() {}

    Node(int _val) {
        val = _val;
    }

    Node(int _val, vector<Node*> _children) {
        val = _val;
        children = _children;
    }
};

class Solution {
public:
    char dismantlingAction(string arr) {
        int hashMap[26] = { 0 };
        for (auto e : arr) hashMap[e - 'a']++;

        for (int i = 0; i < arr.size(); i++) {
            if (hashMap[arr[i] - 'a'] == 1) return arr[i];
        }
        return ' ';
    }
};

class Solution
{
public:
    vector<vector<int>> levelOrder(Node* root)
    {
        if (root == nullptr) return {};
        queue<Node*> q;
        vector<vector<int>> ret;
        q.push(root);
        while (!q.empty())
        {
            int size = q.size();
            vector<int> tmp;
            while (size--)
            {
                Node* f = q.front();
                q.pop();
                tmp.push_back(f->val);
                for (auto e : f->children)
                {
                    q.push(e);
                }
            }
            ret.push_back(tmp);
        }
        return ret;
    }
};